#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
    if(argc < 2)
    {
        // printf("No file input!\n");
        exit(EXIT_FAILURE);
    }
    char *path = argv[1];
    mode_t mode = 0777;
    int file = open(path, O_RDWR | O_CREAT, mode);
    if (file < 0)
    {
        printf("Can't open file!\n");
        exit(EXIT_FAILURE);
    }

    char c;
    while(read(file, &c, sizeof(c)))
    {
        printf("%c", c);
    }
    close(file);
    printf("%s", path);
    return 0;
}